package com.mall.users.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mall.model.domain.UmsMemberLevel;
import com.mall.users.mapper.UmsMemberLevelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UmsMemberLevelService {
    @Autowired(required = false)
    private UmsMemberLevelMapper umsMemberLevelMapper;

    /**
     * 查询所有会员等级
     *
     * @param defaultStatus
     * @return
     */
    public List list(Integer defaultStatus) {
        LambdaQueryWrapper<UmsMemberLevel> qw = new LambdaQueryWrapper<>();
        qw.eq(UmsMemberLevel::getDefaultStatus, defaultStatus);
        List<UmsMemberLevel> umsMemberLevels = umsMemberLevelMapper.selectList(qw);
        return umsMemberLevels;
    }
}
